﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainContent.Master" Inherits="System.Web.Mvc.ViewPage<Fao.Web.Models.ExtendEquipmentType>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	创建扩展字段
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.Partial("ETTree",ViewData["equipmenttypes"]) %>
<div id="rightBox">

    <h2>创建扩展字段</h2>
    <% Html.EnableClientValidation(); %>
    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.Field) %>
            </div>
            <div class="editor-field">
               
                <%: Html.EditorFor(model => model.Field)%>
                <%: Html.ValidationMessageFor(model => model.Field)%>
               
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.FieldName) %>
            </div>
            <div class="editor-field">
                <%: Html.EditorFor(model => model.FieldName)%>
                <%: Html.ValidationMessageFor(model => model.FieldName) %>
            </div>            
          
             <div class="editor-label">
                <%: Html.LabelFor(model => model.ExtendPropertyType)%>
            </div>
            <div class="editor-field">    
            
             
                <%: Html.DropDownListFor(model => model.ExtendPropertyType, ViewData["extendtype"] as IList<SelectListItem>)%>
                <%: Html.ValidationMessageFor(model => model.ExtendPropertyType)%>             
              
            </div>
            <span id="spanV" style="display:none;">
              <div class="editor-label">
                <%: Html.LabelFor(model => model.InitValues) %>
            </div>
            <div class="editor-field">
                <%: Html.EditorFor(model => model.InitValues)%>
                <%: Html.ValidationMessageFor(model => model.InitValues) %>
                请输入选项，1行表示一个选项，如果为空，则转换为单行文本类型。
            </div>
            </span>           
            
           
            <div class="editor-label">
                <%: Html.LabelFor(model => model.IsNull) %>
            </div>
            <div class="editor-field">
                <%: Html.EditorFor(model => model.IsNull)%>
                <%: Html.ValidationMessageFor(model => model.IsNull)%>
            </div>
            
            <p>
                <input type="submit" value="保存" /> <input type="button" value="返回" />
            </p>
        </fieldset>

    <% } %>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
<script type="text/javascript">
    $(document).ready(function () {
        $('#ExtendPropertyType').change(function () {
            // alert($('#ExtendPropertyType').val());
            if ($('#ExtendPropertyType').val() == '8' || $('#ExtendPropertyType').val() == '7') {
                $('#spanV').show();
            }
            else {
                $('#spanV').hide();
            }

        });

        var hide = '<%=Request.QueryString["eid"] %>';
        var type=<%=(int)Model.ExtendPropType %>;
        if(hide!='' &&( type=='8' || type=='9')){
             $('#spanV').show();
        }
             
    });
   
</script>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>

